package board.renders.basics;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;

import board.renders.adapters.LineRenderAdapter;
/** Render gray 1 px grid lines.  
 * 
 *  This is the default render for GridPane.  
 * 
 * @author R.Wisniewski1101
 */
public class BasicLineRender extends LineRenderAdapter {
	@Override
	public boolean isVerticalFirst() {return true;}
	@Override
	public Image getHorizontalLine(int lineNumber, int width) {
		Image lineH = new BufferedImage(width, 1, BufferedImage.TYPE_INT_RGB);
		Graphics draw = lineH.getGraphics();
		draw.setColor(Color.GRAY);
		draw.fillRect(0, 0, width, 1);
		draw.dispose();
		return lineH;
	}
	@Override
	public Image getVerticalLine(int lineNumber, int height) {
		Image lineV = new BufferedImage(1, height, BufferedImage.TYPE_INT_RGB);
		Graphics draw = lineV.getGraphics();
		draw.setColor(Color.GRAY);
		draw.fillRect(0, 0, 1, height);
		draw.dispose();
		return lineV;
	}
}
